package com.daka.vo.response;

import com.daka.entity.User;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;

/**
 * Created by yangx
 * CreateTime: 2016/12/12 19:44
 */
@Data
@ToString
public class DonationSimpVo {

    private BigDecimal total;

    private Long userId;

    private String userName;

    private String userHeadUrl;

    public static DonationSimpVo build(User user,BigDecimal total) {
        DonationSimpVo donationSimpVo = new DonationSimpVo();
        donationSimpVo.setTotal(total.divide(BigDecimal.valueOf(100)));
        donationSimpVo.setUserId(user.getId());
        donationSimpVo.setUserHeadUrl(user.getHeadUrl());
        donationSimpVo.setUserName(user.getName());
        return donationSimpVo;
    }
}
